home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / mailer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-09  |  24.7 KB  |  789 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software <no-Inc>                   */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          No-Cost<no-tm> Software.                       */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello  */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                 This module was written by Bob Hartman                   */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*                   BinkleyTerm Mail Control Routines                      */
  17. /*                                                                          */
  18. /*                                                                          */
  19. /*                                                                          */
  20. /*    For complete  details  of the licensing restrictions, please refer    */
  21. /*    to the License  agreement,  which  is published in its entirety in    */
  22. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.210.    */
  23. /*                                                                          */
  24. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  25. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  26. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  27. /*    NOT HAVE THESE FILES,  YOU SHOULD  IMMEDIATELY CONTACT THE AUTHORS    */
  28. /*    AT THE  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO    */
  29. /*    USE   THIS  FILE  WITHOUT  HAVING   ACCEPTED  THE  TERMS  OF   THE    */
  30. /*    BINKLEYTERM  LICENSING AGREEMENT,  OR SUCH OTHER  AGREEMENT AS YOU    */
  31. /*    ARE ABLE TO REACH WITH THE AUTHORS.                                   */
  32. /*                                                                          */
  33. /*                                                                          */
  34. /*    The Authors can be reached at the following addresses:                */
  35. /*                                                                          */
  36. /*    Robert C. Hartman                      Vincent E. Perriello           */
  37. /*    Spark Software                         VEP Software                   */
  38. /*    427-3 Amherst Street                   111 Carroll Street             */
  39. /*    CS2032, Suite 232                      Naugatuck, CT 06770            */
  40. /*    Nashua, NH 03061                                                      */
  41. /*                                                                          */
  42. /*    FidoNet 1:132/101                      FidoNet 1:141/491              */
  43. /*    Data    (603) 888-8179                 Data    (203) 729-7569         */
  44. /*                                                                          */
  45. /*    Please feel free to contact us at any time to share your comments     */
  46. /*    about our software and/or licensing policies.                         */
  47. /*                                                                          */
  48. /*--------------------------------------------------------------------------*/
  49.  
  50. #include <stdio.h>
  51. #include <signal.h>
  52. #include <ctype.h>
  53. #include <conio.h>
  54. #include <sys/types.h>
  55. #include <sys/stat.h>
  56. #include <string.h>
  57. #include <fcntl.h>
  58. #include <time.h>
  59. #include <process.h>
  60. #include <stdlib.h>
  61. #include <io.h>
  62.  
  63. #include "com.h"
  64. #include "xfer.h"
  65. #include "zmodem.h"
  66. #include "keybd.h"
  67. #include "sbuf.h"
  68. #include "sched.h"
  69. #include "externs.h"
  70. #include "prototyp.h"
  71. #include "vfossil.h"
  72.  
  73. int unattended ()
  74. {
  75.    MAILP mp;
  76.    int bzone, bnet, bnode;
  77.    int i, j, m, r, tmp;
  78.    long init_timer, t, t1;                       /* used for the timeouts  */
  79.    int done = 1;                                 /* if we exit with this, get
  80.                                                   * out of BT */
  81.    FILE *tfile;
  82.    char jbuf[60];
  83.  
  84.    un_attended = 1;
  85.    clear_statusline ();
  86.  
  87.    comm_bits = BITS_8;
  88.    parity = NO_PARITY;
  89.    stop_bits = STOP_1;
  90.    MDM_ENABLE (btypes[baud].rate);
  91.  
  92.    if (fullscreen)
  93.       {
  94.       scr_printf ("\033[H\033[2J");
  95.       sb_dirty ();
  96.       }
  97.  
  98.    opening_banner ();
  99.  
  100.    if (fullscreen)
  101.       {
  102.       mailer_banner ();
  103.       }
  104.  
  105.    if ((tfile = fopen ("BINKLEY.BAN", "rb")) != NULL)
  106.       {
  107.       fread (BBSwelcome, 1, 1000, tfile);
  108.       fclose (tfile);
  109.       }
  110.    else
  111.       {
  112.       BBSwelcome[0] = '\0';
  113.       }
  114.  
  115.    /* Initialize the random number generator */
  116.    i = (int) time (NULL);
  117.    srand (i);
  118.  
  119.    status_line ("+begin, %s", xfer_id);
  120.    set_xy ("");
  121.    XON_DISABLE ();
  122.  
  123.    /* Turn off forced events */
  124.    if (noforce)
  125.       {
  126.       find_event ();
  127.       noforce = 0;
  128.       }
  129.    if (redo_dynam)
  130.       {
  131.       for (i = 0; i < num_events; i++)
  132.          {
  133.          e_ptrs[i]->behavior &= ~MAT_SKIP;
  134.          }
  135.       redo_dynam = 0;
  136.       }
  137.  
  138.    /*
  139.     * See if we should exit before initializing the modem (and therefore
  140.     * possibly letting a call sneak through)
  141.     */
  142.    find_event ();
  143.    do_ready ("Init   ");
  144.  
  145.    /* Make sure twe have all necessary parameters and that the nodelist
  146.     * index gets read in. If not, then we must exit right now.
  147.     */
  148.  
  149.    if (!net_params || !nodefind (alias[0].Zone, boss_net, boss_node, 0)){
  150.       status_line (":something not configured. BOSSnet? BOSSnode?");   /*PLF Mon  05-08-1989  06:53:03 */
  151.       errl_exit (254);
  152.    }
  153.  
  154.    /* Set up outbound mail */
  155.    xmit_reset ();
  156.  
  157.  
  158.    /* and remember where we left off */
  159.    if (hist.next_net != 0)
  160.       {
  161.       bzone = hist.next_zone;
  162.       bnet = hist.next_net;
  163.       bnode = hist.next_node;
  164.       mp = find_mail (bzone, bnet, bnode);
  165.       if ((mp == NULL) || (mp->prev == NULL))
  166.          {
  167.          next_mail = NULL;
  168.          xmit_window (mail_top);
  169.          }
  170.       else
  171.          {
  172.          next_mail = mp->prev;
  173.          xmit_window (next_mail);
  174.          }
  175.       }
  176.  
  177.    if (!CARRIER)
  178.       {
  179.       mdm_init (modem_init);                     /* Reinitialize the modem  */
  180.       }
  181.  
  182.    init_timer = timerset ((unsigned int)60000);  /* Set a 10 minute timer */
  183.    t1 = timerset (6000);                         /* Set a 1 minute timer  */
  184.  
  185. top_of_mail:
  186.    un_attended = 1;
  187.    i = 0;
  188.    m = 1;
  189.  
  190.    /* As long as we don't press a key */
  191. bad_char:
  192.    r = 0;
  193.    more_mail = 1;
  194.    while (!(KEYPRESS () || ctrlc_ctr))
  195.       {
  196.       find_event ();
  197.  
  198.       /* Show that we are ready */
  199.       if (m)
  200.          {
  201.          if (fullscreen)
  202.             {
  203.             do_ready ("Waiting");
  204.             }
  205.          else
  206.             {
  207.             status_line (" Event %d - Waiting", cur_event + 1);
  208.             }
  209.      init_timer = timerset ((unsigned int)60000); /* Set a 10 minute timer */
  210.          t1 = timerset (6000);                   /* Set a 1 minute timer */
  211.          }
  212.  
  213.       if (timeup (t1))
  214.          {
  215.          put_up_time ();
  216.          t1 = timerset (6000);                   /* Set a 1 minute timer */
  217.          }
  218.  
  219.       /* If we haven't gotten anything in 10 minutes, re-init the modem */
  220.       if (timeup (init_timer))
  221.          {
  222.          mdm_init (modem_init);
  223.      init_timer = timerset ((unsigned int)60000); /* Set a 10 minute timer */
  224.  
  225.          /*
  226.           * Say that we have more mail so that things entered through other
  227.           * side of a multi-tasker will still go out
  228.           */
  229.          xmit_reset ();
  230.          more_mail = 1;
  231.  
  232.          screen_blank = 1;
  233.          sb_show ();
  234.          }
  235.  
  236.       m = 0;
  237.  
  238.       if (((cur_event >= 0) && (!(e_ptrs[cur_event]->behavior & MAT_OUTONLY)))
  239.           || (cur_event < 0))
  240.          {
  241.          t = 0; /*PLF Tue  05-09-1989  11:28:48 */
  242.          /* set up the amount of time to wait at random */
  243.          if(cur_event >= 0) /*PLF Mon  05-08-1989  06:35:34; bug fix. stop os/2 GP fault */
  244.              t = random_time (e_ptrs[cur_event]->wait_time);
  245.  
  246.          if(!t) t = random_time (5);  /*PLF Tue  05-09-1989  11:02:20 */
  247.  
  248.          while ((!timeup (t)) && (!KEYPRESS ()) && (m == 0) && !ctrlc_ctr)
  249.             {
  250.             find_event ();
  251.  
  252.             time_release ();
  253.  
  254.             if (timeup (t1))
  255.                {
  256.                put_up_time ();
  257.                t1 = timerset (6000);             /* Set a 1 minute timer */
  258.                }
  259.  
  260.             /* See if we need to handle inbound mail   */
  261.             if (m = handle_inbound_mail ())
  262.                {
  263.                /* If we sent out anything, make sure we reset stuff */
  264.                xmit_sameplace ();
  265.                }
  266.             }
  267.  
  268. /* Modified */
  269.           /*SCB*/ if ((m) && (fullscreen))
  270.             {
  271.             do_ready ("Waiting");
  272.             }
  273.          }
  274.  
  275. immed_call:
  276.  
  277.       find_event ();
  278.  
  279.       /* If we are not in an event, loop again */
  280.       if (cur_event < 0)
  281.          {
  282.          time_release ();
  283.          continue;
  284.          }
  285.  
  286.       /* If we have pressed a key, get out */
  287.       if (KEYPRESS () || ctrlc_ctr)
  288.          break;
  289.  
  290.       /* See if we are supposed to do any mail */
  291.       if (e_ptrs[cur_event]->behavior & MAT_NOOUT)
  292.          {
  293.          continue;
  294.          }
  295.  
  296.       if (more_mail)
  297.          {
  298.          if (more_mail = xmit_next (&bzone, &bnet, &bnode))
  299.             {
  300.             /* save the next call in the list in case we exit */
  301.             if ((next_mail == NULL) || (next_mail->next == NULL))
  302.                {
  303.                mp = mail_top;
  304.                }
  305.             else
  306.                {
  307.                mp = next_mail->next;
  308.                }
  309.             hist.next_zone = mp->zone;
  310.             hist.next_net = mp->net;
  311.             hist.next_node = mp->node;
  312.  
  313.             screen_blank = 0;
  314.             m = do_mail (bzone, bnet, bnode, 0);
  315.  
  316.             r = (m == 1) ? 1 : 0;
  317.  
  318.             if (r)                               /* Did we connect? */
  319.                {
  320.                if (!sent_mail)
  321.                   {
  322.                   /* We connected but the transfer didn't work */
  323.                   bad_call (bzone, bnet, bnode, 1);
  324.                   }
  325.                else
  326.                   {
  327.                   /* We got through, so delete his status file */
  328.                   bad_call (bzone, bnet, bnode, -1);
  329.                   xmit_delete ();
  330.                   }
  331.                }
  332.  
  333.             else if (m == 2)                     /* Nothing happened */
  334.                {
  335.                bad_call (bzone, bnet, bnode, 2);
  336.                }
  337.  
  338.             /* If we did some processing */
  339.             if (m > 0)
  340.                {
  341.                /* We got inbound mail */
  342.                if (got_arcmail || got_packet || got_mail)
  343.                   {
  344.                   receive_exit ();
  345.                   }
  346.                }
  347.             else if (m == -1)
  348.                {
  349.                status_line (":Incoming call, dial aborted");
  350.                }
  351.             }
  352.          }
  353.  
  354.       if (!more_mail)
  355.          {
  356.          /* No more mail to do, was it dynamic? */
  357.          if (e_ptrs[cur_event]->behavior & MAT_DYNAM)
  358.             {
  359.             screen_blank = 0;
  360.             e_ptrs[cur_event]->behavior |= MAT_SKIP;
  361.             status_line (":End of Dynamic Event %d", cur_event + 1);
  362.             goto top_of_mail;
  363.             }
  364.          }
  365.       }
  366.  
  367.    screen_blank = 0;
  368.    sb_show ();
  369.  
  370.    /* Eat the character we pressed */
  371.    if (ctrlc_ctr || !KEYPRESS ())
  372.       {
  373.  
  374.       /*
  375.        * Be serious, there had to be a key pressed or we wouldn't be here I
  376.        * know it sounds silly, but ^C will sometimes do crap like this
  377.        */
  378.       status_line (":Exit requested from keyboard");
  379.       }
  380.    else
  381.       {
  382.       i = FOSSIL_CHAR ();
  383.       if ((i & 0xff) == 0)
  384.          {
  385.          switch (i)
  386.             {
  387.             case PF1:
  388.             case PF2:
  389.             case PF3:
  390.             case PF4:
  391.             case PF5:
  392.             case PF6:
  393.             case PF7:
  394.             case PF8:
  395.             case PF9:
  396.             case PF10:
  397.                i = i >> 8;
  398.                status_line (":Function key exit - errorlevel %d", (i - 0x3a) * 10);
  399.                errl_exit ((i - 0x3a) * 10);
  400.  
  401.             case ALTB:
  402.                screen_blank = 1;
  403.                sb_show ();
  404.                goto bad_char;
  405.  
  406.             case ALTC:
  407.                tmp = hist.which_day;
  408.                memset (&hist, 0, sizeof (HISTORY));
  409.                hist.which_day = tmp;
  410.                if (fullscreen)
  411.                   {
  412.                   do_today ();
  413.                   sb_show ();
  414.                   }
  415.                goto bad_char;
  416.  
  417.             case ALTE:
  418.                if (BBSreader != NULL)
  419.                   {
  420.                   vfossil_cursor (1);
  421.                   status_line (" Disabling Modem");
  422.                   mdm_init (modem_busy);
  423.                   DTR_OFF ();
  424.                   status_line (":Invoking Message Reader");
  425.                   vfossil_close ();
  426.                   b_spawn (BBSreader);
  427.                   vfossil_init ();
  428.                   if (fullscreen)
  429.                      {
  430.                      scr_printf ("\033[H\033[2J");
  431.                      sb_dirty ();
  432.                      opening_banner ();
  433.                      mailer_banner ();
  434.                      }
  435.                   status_line (":Message Reader returned to BinkleyTerm");
  436.                   xmit_reset ();
  437.                   m = 1;
  438.                   status_line (" Enabling Modem");
  439.                   DTR_ON ();
  440.                   mdm_init (modem_init);
  441.                   goto immed_call;
  442.                   }
  443.                else
  444.                   {
  445.                   set_xy (NULL);
  446.                   status_line ("!No Message Reader to invoke");
  447.                   set_xy (NULL);
  448.                   m = 1;
  449.                   goto bad_char;
  450.                   }
  451.  
  452.             case ALTJ:
  453.                goto do_esc;
  454.  
  455.             case ALTM:
  456.                status_line (":Entering POLL Mode");
  457.                 /*SCB*/ if (fullscreen)
  458.                   gotoxy (0, 21);
  459. /*
  460.                tmp = fullscreen;
  461.                fullscreen = 0;
  462. */
  463.                vfossil_cursor (1);
  464.                scr_printf ("\r\nPlease enter a net/node number: ");
  465.                scr_printf (local_CEOL);
  466.                if (m = get_number (jbuf))
  467.                   {
  468.                   if ((m = sscanf (jbuf, "%d:%d/%d", &bzone, &bnet, &bnode)) != 3)
  469.                      {
  470.                      bzone = 0;
  471.                      if ((m = sscanf (jbuf, "%d/%d", &bnet, &bnode)) != 2)
  472.                         {
  473.                         bzone = alias[0].Zone;
  474.                         bnet = alias[0].Net;
  475.                         if ((m = sscanf (jbuf, "%d", &bnode)) == 1)
  476.                            {
  477.                            m = 3;
  478.                            }
  479.                         }
  480.                      else
  481.                         {
  482.                         m = 3;
  483.                         }
  484.                      }
  485.                   }
  486.                if (fullscreen)
  487.                   {
  488.                   gotoxy (0, 22);
  489.                   scr_printf (local_CEOL);
  490.                   bottom_line ();
  491.                   vfossil_cursor (0);
  492.                   sb_show ();
  493.                   }
  494.                doing_poll = 1;
  495.                if (m >= 2 && nodefind (bzone, bnet, bnode,1))
  496.                   {
  497.                   if (!bzone)
  498.                      bzone = found_zone;
  499.                   if (fullscreen)
  500.                      {
  501.                      sb_move (filewin, 1, 2);
  502.                      sb_puts (filewin, "Currently Polling Node ");
  503.                      sb_puts (filewin, jbuf);
  504.                      }
  505.                   if ((do_mail (bzone, bnet, bnode, 1) == 1) && sent_mail)
  506.                      {
  507.                      next_mail = find_mail (bzone, bnet, bnode);
  508.                      bad_call (bzone, bnet, bnode, -1);
  509.                      xmit_delete ();
  510.                      }
  511.                   }
  512.                doing_poll = 0;
  513.                status_line (":Poll completed");
  514.                if (fullscreen)
  515.                   {
  516.                   clear_filetransfer ();
  517.                   }
  518.                DTR_ON ();
  519.                mdm_init (modem_init);
  520.                m = 1;
  521.                goto bad_char;
  522.  
  523.             case ALTQ:
  524.                if (cur_event != -1)
  525.                   e_ptrs[cur_event]->behavior |= MAT_SKIP;
  526.                goto top_of_mail;
  527.  
  528.             case ALTR:
  529.                for (j = 0; j < num_events; j++)
  530.                   {
  531.                   /* Don't redo forced events */
  532.                   if (!(e_ptrs[j]->behavior & MAT_FORCED))
  533.                      {
  534.                      e_ptrs[j]->last_ran = -1;
  535.                      e_ptrs[j]->behavior &= ~MAT_SKIP;
  536.                      }
  537.                   }
  538.                goto top_of_mail;
  539.  
  540.             case ALTT:
  541.                status_line (":Keyboard request to enter terminal mode");
  542.                b_init ();
  543.                done = 0;                         /* We won't exit now */
  544.                goto mail_done;
  545.  
  546.             case ALTW:
  547.                if (fullscreen)
  548.                   {
  549.                   scr_printf ("\033[H\033[2J");
  550.                   sb_dirty ();
  551.                   sb_show ();
  552.                   }
  553.                goto bad_char;
  554.  
  555.             case ALTF10:
  556.                mailer_help ();
  557.                if (fullscreen)
  558.                   {
  559.                   scr_printf ("\033[H\033[2J");
  560.                   sb_dirty ();
  561.                   opening_banner ();
  562.                   mailer_banner ();
  563.                   }
  564.                m = 1;
  565.                goto bad_char;
  566.  
  567.             case ALTX:
  568.                status_line (":Exit requested from keyboard");
  569.                goto mail_done;
  570.  
  571.             case ALTF1:
  572.             case ALTF2:
  573.             case ALTF3:
  574.             case ALTF4:
  575.             case ALTF5:
  576.             case ALTF6:
  577.             case ALTF7:
  578.             case ALTF8:
  579.             case ALTF9:
  580.                j = (i >> 8) - 0x68;
  581.                if (shells[j] != NULL)
  582.                   {
  583.                   status_line (":Executing keyboard shell %d", j + 1);
  584.                   mdm_init (modem_busy);
  585.                   DTR_OFF ();
  586.                   close_up ();
  587.                   vfossil_cursor (1);
  588.                   b_spawn (shells[j]);
  589.                   come_back ();
  590.                   m = 1;
  591.                   status_line (":Returning from keyboard shell");
  592.                   scr_printf ("\033[H\033[2J");
  593.                   if (fullscreen)
  594.                      sb_dirty ();
  595.                   opening_banner ();
  596.                   mailer_banner ();
  597.                   xmit_reset ();
  598.                   DTR_ON ();
  599.                   mdm_init (modem_init);
  600.                   goto immed_call;
  601.                   }
  602.  
  603.                status_line ("!No keyboard shell %d", j + 1);
  604.                goto bad_char;
  605.  
  606.             case PGUP:
  607.                if (next_mail == NULL)
  608.                   {
  609.                   next_mail = mail_top;
  610.                   }
  611.  
  612.                if (next_mail != NULL)
  613.                   {
  614.                   for (j = 0; j < 4; j++)
  615.                      {
  616.                      if (next_mail->prev != NULL)
  617.                         next_mail = next_mail->prev;
  618.                      }
  619.                   xmit_window (next_mail);
  620.                   }
  621.                goto bad_char;
  622.  
  623.             case PGDN:
  624.                if (next_mail == NULL)
  625.                   {
  626.                   next_mail = mail_top;
  627.                   }
  628.  
  629.                if (next_mail != NULL)
  630.                   {
  631.                   for (j = 0; j < 4; j++)
  632.                      {
  633.                      if (next_mail->next != NULL)
  634.                         next_mail = next_mail->next;
  635.                      }
  636.                   xmit_window (next_mail);
  637.                   }
  638.                goto bad_char;
  639.  
  640.             case UPAR:
  641.                if (next_mail == NULL)
  642.                   {
  643.                   next_mail = mail_top;
  644.                   }
  645.  
  646.                if (next_mail != NULL)
  647.                   {
  648.                   if (next_mail->prev != NULL)
  649.                      next_mail = next_mail->prev;
  650.                   xmit_window (next_mail);
  651.                   }
  652.                goto bad_char;
  653.  
  654.             case DNAR:
  655.                if (next_mail == NULL)
  656.                   {
  657.                   next_mail = mail_top;
  658.                   }
  659.  
  660.                if (next_mail != NULL)
  661.                   {
  662.                   if (next_mail->next != NULL)
  663.                      next_mail = next_mail->next;
  664.                   xmit_window (next_mail);
  665.                   }
  666.                goto bad_char;
  667.  
  668.             case HOME:
  669.                next_mail = mail_top;
  670.                xmit_window (next_mail);
  671.                goto bad_char;
  672.  
  673.             case END:
  674.                if (next_mail == NULL)
  675.                   {
  676.                   next_mail = mail_top;
  677.                   }
  678.  
  679.                if (next_mail != NULL)
  680.                   {
  681.                   while (next_mail->next != NULL)
  682.                      {
  683.                      next_mail = next_mail->next;
  684.                      }
  685.                   }
  686.  
  687.                for (j = 0; j < 3; j++)
  688.                   {
  689.                   if (next_mail->prev != NULL)
  690.                      next_mail = next_mail->prev;
  691.                   }
  692.                xmit_window (next_mail);
  693.                goto bad_char;
  694.  
  695.             default:
  696.                status_line (" Junk character from keyboard - continuing");
  697.                m = 1;
  698.                goto bad_char;
  699.             }
  700.          }
  701.       else
  702.          {
  703.          switch (i & 0xff)
  704.             {
  705.             case ESC:   /*PLF Mon  05-08-1989  08:02:13 ; had to move code around a bit, the optimixer has having probs.*/
  706.          do_esc:
  707.                status_line (":Exiting to DOS");
  708.                 /*SCB*/ if (fullscreen)
  709.                   gotoxy (0, 23);
  710.                vfossil_cursor (1);
  711.                cputs ("Type EXIT to return to BT");
  712.                DTR_OFF ();
  713.                change_prompt ();
  714.                b_spawn (NULL);
  715.                if (fullscreen)
  716.                   {
  717.                   scr_printf ("\033[H\033[2J");
  718.                   sb_dirty ();
  719.                   opening_banner ();
  720.                   mailer_banner ();
  721.                   }
  722.                status_line (":BinkleyTerm Reactivated");
  723.                m = 1;
  724.                xmit_reset ();
  725.  
  726.                /* and remember where we left off */
  727.                if (hist.next_net != 0)
  728.                   {
  729.                   bzone = hist.next_zone;
  730.                   bnet = hist.next_net;
  731.                   bnode = hist.next_node;
  732.                   mp = find_mail (bzone, bnet, bnode);
  733.                   if ((mp == NULL) || (mp->prev == NULL))
  734.                      {
  735.                      next_mail = NULL;
  736.                      xmit_window (mail_top);
  737.                      }
  738.                   else
  739.                      {
  740.                      next_mail = mp->prev;
  741.                      xmit_window (next_mail);
  742.                      }
  743.                   }
  744.  
  745.                DTR_ON();
  746.                goto bad_char;
  747.             case 'C':
  748.             case 'c':
  749.                if( cur_event >= 0 ) /*PLF Mon  05-08-1989  11:37:12 */
  750.                    if (e_ptrs[cur_event]->behavior & MAT_NOOUT)
  751.                       {
  752.                       status_line ("!Calls not permitted during this event.");
  753.                       goto immed_call;
  754.                       }
  755.  
  756.                status_line (" Immediate call requested");
  757.                m = 0;
  758.                more_mail = 1;
  759.                goto immed_call;
  760.  
  761.             case 3:
  762.                status_line (":Exit requested from keyboard");
  763.                goto mail_done;
  764.  
  765.  
  766.             case 0x20:
  767.                m = 1;
  768.                goto bad_char;
  769.  
  770.             default:
  771.                status_line (" Junk character from keyboard - continuing");
  772.                m = 1;
  773.                goto bad_char;
  774.             }
  775.          }
  776.       }
  777.  
  778. mail_done:
  779.    write_sched ();
  780.    status_line ("+end, %s", xfer_id);
  781.    un_attended = 0;
  782.     /*SCB*/ if (fullscreen)
  783.       {
  784.       gotoxy (0, 23);
  785.       }
  786.    XON_ENABLE ();
  787.    return (done);
  788. }
  789.